<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input id="id" hidden="hidden" th:value="${param.id}" />
<input id="notesName" th:value="${param.notesName}" />
<input type="button" id="sure" value="确定">

<script src="js/layui/layui.js"></script>
<script>
    layui.use(['element', 'layer'], function () {
        var element = layui.element;
        var $ = layui.$;
        var layer = layui.layer;


        $('body').on('click','#sure',function () {
            console.log($('#id').val());
        $.ajax({
            data:{
                id:$('#id').val(),
                noteName:$('#notesName').val(),
                token:sessionStorage.getItem("accessToken"),
            },
            url:'http://338de254.cpolar.io/note-notes/notes/updateName',
            success:function (d) {
                if (d.rs) {
                    console.log(d);
                    parent.layer.msg('修改成功', {icon: 1});
                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    parent.layer.close(index); //再执行关闭
                    parent.window.location.reload();

                }
            }
        })
    })
    })
</script>
</body>
</html>